#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include <QMouseEvent>
#include <QWheelEvent>
#include <QTimerEvent>
#include <QMoveEvent>
#include <QResizeEvent>


QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    ~Widget();

    //鼠标移动事件
    void mouseMoveEvent(QMouseEvent*event)override;
    //鼠标滚轮滚动事件
    void wheelEvent(QWheelEvent* event)override;
    //键盘按键事件
    void keyPressEvent(QKeyEvent *event) override;
    //定时器事件
    void timerEvent(QTimerEvent*event)override;
    //窗口移动事件
    void moveEvent(QMoveEvent *event)override;
    //窗口大小改变事件
    void resizeEvent(QResizeEvent *event)override;

private:
    Ui::Widget *ui;
    int timerId;
};
#endif // WIDGET_H
